<?php
/**
 * spsNewsletter newsletter view
 * 
 * @author Satyan Shah <joomlaDesign@modernbridge.com>
 * @link http://www.modernbridge.com
 * @license GNU/GPL
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

jimport( 'joomla.application.component.view' );

class spsNewslettersViewnewsletter extends JView
{

	function display($tpl = null)
	{
		// retrieve newsletter to view
		$newsletterRecord=& $this->get('Data');
		$isNew = ($newsletterRecord->id < 1);
		$text = $isNew ? JText::_( 'New' ) : JText::_( 'Edit' );
		JToolBarHelper::title(   JText::_( 'Hello' ).': <small><small>[ ' . $text.' ]</small></small>' );
		JToolBarHelper::save();
		if ($isNew)  {
			JToolBarHelper::cancel();
		} else {
			// for existing items the button is renamed `close`
			JToolBarHelper::cancel( 'cancel', 'Close' );
		}

		$this->assignRef('newsletterRecord',$newsletterRecord);

		parent::display($tpl);
	}
}
